package com.tech.connect.api;

import com.tech.connect.model.ItemQuznZi;
import com.tech.connect.model.PagerModel;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.POST;

public class QuznZiHttp {
    public static Map<String, Object> getMap() {
        return new HashMap<>();
    }

    public interface ConnectApiServer {
        @POST("v1/service-circle/create")
        Observable<BaseEntity<Object>> create(@Body Map<String, Object> map);

        @POST("v1/service-circle/page")
        Observable<BaseEntity<PagerModel<ItemQuznZi>>> list(@Body Map<String, Object> map);
    }

    public static Observable<BaseEntity<Object>> create(Map<String, Object> map, final BaseEntityOb<Object> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).create(map));
    }

    public static Observable<BaseEntity<PagerModel<ItemQuznZi>>> list(Map<String, Object> map, final BaseEntityOb<PagerModel<ItemQuznZi>> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).list(map));
    }

}
